package com.goodving.guli.bt.model;

import android.content.ContentValues;
import android.database.Cursor;
import android.os.Parcel;
import android.os.Parcelable;

import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;
import com.goodving.guli.view.C3657a;

/**
 * Created by john on 2015/12/1.
 */
@Table(name = "friend")
public class Friend extends C0850d implements Parcelable {
    public static final Creator<Friend> CREATOR;
    public static final String f7786b = "user_id";
    public static final String f7787c = "username";
    public static final String f7788d = "weight";
    public static final String f7789e = "step";
    public static final String f7790f = "sleep";
    public static final String f7791g = "updateTime";
    public static final String f7792h = "icon";
    public static final String f7793i = "careByHim";
    public static final String f7794j = "careByMe";
    public static final String f7795k = "detail_update_time";
    public static final String f7796l = "remark_name";
    public static final String f7797m = "create_time";
    @Column(name = "user_id", unique = true)
    public long f7798n;
    @Column(name = "username")
    public String f7799o;
    @Column(name = "icon")
    public String f7800p;
    @Column(name = "weight")
    public int f7801q;
    @Column(name = "step")
    public int f7802r;
    @Column(name = "sleep")
    public int f7803s;
    @Column(name = "careByHim")
    public int f7804t;
    @Column(name = "careByMe")
    public int f7805u;
    @Column(name = "updateTime")
    public long f7806v;
    @Column(name = "detail_update_time")
    public long f7807w;
    @Column(name = "remark_name")
    public String f7808x;
    @Column(name = "create_time")
    public long f7809y;

    static {
        CREATOR = new C1539c();
    }

    public Friend() {
        this.f7801q = 0;
        this.f7802r = 0;
        this.f7803s = 0;
        this.f7804t = 0;
        this.f7805u = 0;
        this.f7806v = 0;
        this.f7807w = 0;
        this.f7808x = null;
        this.f7809y = 0;
    }

    public Friend(long j) {
        this.f7801q = 0;
        this.f7802r = 0;
        this.f7803s = 0;
        this.f7804t = 0;
        this.f7805u = 0;
        this.f7806v = 0;
        this.f7807w = 0;
        this.f7808x = null;
        this.f7809y = 0;
        this.f7798n = j;
    }

    public Friend(Parcel parcel) {
        this.f7801q = 0;
        this.f7802r = 0;
        this.f7803s = 0;
        this.f7804t = 0;
        this.f7805u = 0;
        this.f7806v = 0;
        this.f7807w = 0;
        this.f7808x = null;
        this.f7809y = 0;
        this.f7798n = parcel.readLong();
        this.f7799o = parcel.readString();
        this.f7800p = parcel.readString();
        this.f7801q = parcel.readInt();
        this.f7802r = parcel.readInt();
        this.f7803s = parcel.readInt();
        this.f7804t = parcel.readInt();
        this.f7805u = parcel.readInt();
        this.f7806v = parcel.readLong();
        this.f7807w = parcel.readLong();
        this.f7808x = parcel.readString();
        this.f7809y = parcel.readLong();
    }

    public boolean m8939a(Cursor cursor) {
        if (cursor == null) {
            return false;
        }
        int columnIndex = cursor.getColumnIndex(f7786b);
        if (columnIndex < 0) {
            return false;
        }
        this.f7798n = cursor.getLong(columnIndex);
        columnIndex = cursor.getColumnIndex(f7787c);
        if (columnIndex < 0) {
            return false;
        }
        this.f7799o = cursor.getString(columnIndex);
        columnIndex = cursor.getColumnIndex(f7792h);
        if (columnIndex < 0) {
            return false;
        }
        this.f7800p = cursor.getString(columnIndex);
        columnIndex = cursor.getColumnIndex(f7788d);
        if (columnIndex < 0) {
            return false;
        }
        this.f7801q = cursor.getInt(columnIndex);
        columnIndex = cursor.getColumnIndex(f7789e);
        if (columnIndex < 0) {
            return false;
        }
        this.f7802r = cursor.getInt(columnIndex);
        columnIndex = cursor.getColumnIndex(f7790f);
        if (columnIndex < 0) {
            return false;
        }
        this.f7803s = cursor.getInt(columnIndex);
        columnIndex = cursor.getColumnIndex(f7793i);
        if (columnIndex < 0) {
            return false;
        }
        this.f7804t = cursor.getInt(columnIndex);
        columnIndex = cursor.getColumnIndex(f7794j);
        if (columnIndex < 0) {
            return false;
        }
        this.f7805u = cursor.getInt(columnIndex);
        columnIndex = cursor.getColumnIndex(f7791g);
        if (columnIndex < 0) {
            return false;
        }
        this.f7806v = cursor.getLong(columnIndex);
        columnIndex = cursor.getColumnIndex(f7795k);
        if (columnIndex < 0) {
            return false;
        }
        this.f7807w = cursor.getLong(columnIndex);
        columnIndex = cursor.getColumnIndex(f7796l);
        if (columnIndex < 0) {
            return false;
        }
        this.f7808x = cursor.getString(columnIndex);
        columnIndex = cursor.getColumnIndex(f7797m);
        if (columnIndex < 0) {
            return false;
        }
        this.f7809y = cursor.getLong(columnIndex);
        return true;
    }

    public ContentValues m8940b() {
        ContentValues contentValues = new ContentValues();
        contentValues.put(f7786b, Long.valueOf(this.f7798n));
        contentValues.put(f7787c, this.f7799o);
        contentValues.put(f7792h, this.f7800p);
        contentValues.put(f7788d, Integer.valueOf(this.f7801q));
        contentValues.put(f7789e, Integer.valueOf(this.f7802r));
        contentValues.put(f7790f, Integer.valueOf(this.f7803s));
        contentValues.put(f7793i, Integer.valueOf(this.f7804t));
        contentValues.put(f7794j, Integer.valueOf(this.f7805u));
        contentValues.put(f7791g, Long.valueOf(this.f7806v));
        contentValues.put(f7795k, Long.valueOf(this.f7807w));
        contentValues.put(f7796l, this.f7808x);
        contentValues.put(f7797m, Long.valueOf(this.f7809y));
        return contentValues;
    }

    public String m12508c() {
        return (this.f7808x == null || C3657a.f18328f.equals(this.f7808x)) ? this.f7799o : this.f7808x;
    }

    public int describeContents() {
        return 0;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        return this.f7798n == ((Friend) obj).f7798n;
    }

    public int hashCode() {
        return ((int) (this.f7798n ^ (this.f7798n >>> 32))) + 31;
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeLong(this.f7798n);
        parcel.writeString(this.f7799o);
        parcel.writeString(this.f7800p);
        parcel.writeInt(this.f7801q);
        parcel.writeInt(this.f7802r);
        parcel.writeInt(this.f7803s);
        parcel.writeInt(this.f7804t);
        parcel.writeInt(this.f7805u);
        parcel.writeLong(this.f7806v);
        parcel.writeLong(this.f7807w);
        parcel.writeString(this.f7808x);
        parcel.writeLong(this.f7809y);
    }
}
